//
//  chucaiTableViewCell.m
//  gangquOASystem
//
//  Created by michael on 2018/7/27.
//  Copyright © 2018年 czd. All rights reserved.
//

#import "chucaiTableViewCell.h"

@implementation chucaiTableViewCell
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
    self.selectionStyle = UITableViewCellSelectionStyleNone;
self.bgView  = [[UIView alloc]init];
_label1 = [[UILabel alloc]init];
_label1.frame = CGRectZero;
  _label1.textColor = [UIColor colorWithHexString:@"484848"];
_label1.text = @"出差时间";
    _label1.font = [UIFont systemFontOfSize:14];
[self.bgView addSubview:_label1];

_label2 = [[UILabel alloc]init];
_label2.frame = CGRectZero;
_label2.textAlignment = 1;
  _label2.textColor = [UIColor colorWithHexString:@"484848"];
_label2.text = @"到";
    _label2.font = [UIFont systemFontOfSize:14];
[self.bgView addSubview:_label2];
_label3 = [[UILabel alloc]init];
_label3.frame = CGRectZero;
  _label3.textColor = [UIColor colorWithHexString:@"484848"];
_label3.text = @"出差地点";
    _label3.font = [UIFont systemFontOfSize:14];
[self.bgView addSubview:_label3];

_label4 = [[UILabel alloc]init];
_label4.frame = CGRectZero;
  _label4.textColor = [UIColor colorWithHexString:@"484848"];
_label4.text = @"至";
_label4.textAlignment = 1;
    _label4.font = [UIFont systemFontOfSize:14];
[self.bgView addSubview:_label4];

 _timebutton1 = [zhucebutton buttonWithType:UIButtonTypeCustom];

    [_timebutton1 setTitle:@"开始时间" forState:UIControlStateNormal];
    [self.bgView addSubview:_timebutton1];
     _timebutton2 = [zhucebutton buttonWithType:UIButtonTypeCustom];

    [_timebutton2 setTitle:@"结束时间" forState:UIControlStateNormal];
    [self.bgView addSubview:_timebutton2];
    
     _textfield1= [[zhucetextfield alloc]init];
                    _textfield1.delegate = self;

[self.bgView addSubview:_textfield1];

     _textfield2= [[zhucetextfield alloc]init];
                    _textfield2.delegate = self;

[self.bgView addSubview:_textfield2];

}
    self.selectionStyle = UITableViewCellSelectionStyleNone;

return self;

}
- (void)setSeltag:(NSInteger)seltag{
_seltag = seltag;
_textfield2.tag = 100+_seltag;
_textfield1.tag = 200+_seltag;
      _timebutton1.tag =300+ _seltag;
      _timebutton2.tag = 400+_seltag;

}
- (void)layoutSubviews{
[super layoutSubviews];
 self.bgView.frame =  CGRectMake(10, 5, KScreenWidth - 20, 120+10);
    self.bgView.backgroundColor = [UIColor whiteColor];
      self. bgView.layer.borderWidth = 1;
      self.  bgView.layer.borderColor = [[UIColor colorWithHexString:@"aeaeae"] CGColor];
        self.bgView.layer.cornerRadius = 5;
        [self.contentView addSubview:self.bgView];
_label1.frame =  CGRectMake(10, 0,self.bgView.width-20, 20);
 _timebutton1.frame = CGRectMake(10, _label1.bottom, (self.bgView.width-20-50)/2, 40);
_label2.frame = CGRectMake(_timebutton1.right, _label1.bottom,50, 40);
 _timebutton2.frame = CGRectMake(_label2.right, _label1.bottom, (self.bgView.width-20-50)/2, 40);
 _label3.frame =  CGRectMake(10, _timebutton1.bottom,self.bgView.width-20, 20);
 _textfield1.frame = CGRectMake(10, _label3.bottom, (self.bgView.width-20-50)/2, 40);
_label4.frame = CGRectMake(_textfield1.right, _label3.bottom,50, 40);
 _textfield2.frame = CGRectMake(_label4.right, _label3.bottom, (self.bgView.width-20-50)/2, 40);

    
    }
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
